<?php echo $__env->make("system::admin.layouts._header", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<body>
<div class="layuimini-container">
    <form id="app-form" class="layui-form layuimini-form" method="post">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li class="layui-this">基本信息</li>
                <li>拓展配置</li>
            </ul>

            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item  layui-row layui-col-xs12">
                        <label class="layui-form-label required">分类</label>
                        <div class="layui-input-block">
                            <select name="category_id">
                                <?php $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($item['id']); ?>"
                                            <?php if($item['id']==$article->category_id): ?> selected <?php endif; ?>><?php echo e($item['name']); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label required">标题</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" class="layui-input" lay-verify="required"
                                   lay-reqtext="请输入标题" placeholder="请输入标题" value="<?php echo e($article->title); ?>">
                            <tip>填写标题。</tip>
                        </div>
                    </div>

                    <!--<div class="layui-form-item">-->
                    <!--    <label class="layui-form-label">短标题</label>-->
                    <!--    <div class="layui-input-block">-->
                    <!--        <input type="hidden" name="attr[ident][]" value="short_title">-->
                    <!--        <input type="text" name="attr[value][]" class="layui-input"-->
                    <!--               placeholder="请输入短标题" value="<?php echo e($article->short_title); ?>">-->
                    <!--        <tip>填写短标题。</tip>-->
                    <!--    </div>-->
                    <!--</div>-->
                    <div class="layui-form-item">
                        <label class="layui-form-label">签到获积分</label>
                        <div class="layui-input-block">
                            <input type="hidden" name="attr[ident][]" value="sign_point">
                            <input type="text" name="attr[value][]" class="layui-input"
                                   placeholder="签到获积分数" value="<?php echo e($article->sign_point); ?>">
                            <tip>签到获积分数。</tip>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">分享报名获积分</label>
                        <div class="layui-input-block">
                            <input type="hidden" name="attr[ident][]" value="share_point">
                            <input type="text" name="attr[value][]" class="layui-input"
                                   placeholder="分享报名获积分" value="<?php echo e($article->share_point); ?>">
                            <tip>分享报名获积分。</tip>
                        </div>
                    </div>


                    <?php if(app('system')->addonEnabled('UrlFormat')): ?>
                        <div class="layui-form-item">
                            <label class="layui-form-label">别名</label>
                            <div class="layui-input-block">
                                <input type="text" name="alias" class="layui-input" placeholder="请输入别名"
                                       value="<?php echo e(url_format_alias_for_id($article->id,'single')); ?>">
                                <tip>用于URL优化。</tip>
                            </div>
                        </div>
                    <?php endif; ?>

                    <div class="layui-form-item">
                        <label class="layui-form-label">活动结束日期</label>
                        <div class="layui-input-block">
                            <input type="text" name="author" id="a"  class="layui-input" placeholder="填写活动结束日期"
                                   value="<?php echo e($article->author); ?>">
                            <tip>填写活动结束日期。</tip>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">标签</label>
                        <div class="layui-input-block">
                            <input type="text" name="tags" class="layui-input" placeholder="请输入标签" value="<?php echo e($tags); ?>">
                            <tip>多个标签请用英文逗号（,）分开。</tip>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">缩略图</label>
                        <div class="layui-input-block layuimini-upload">
                            <input name="img" class="layui-input layui-col-xs6" placeholder="请上传缩略图"
                                   value="<?php echo e($article->img); ?>">
                            <div class="layuimini-upload-btn">
                                <span><a class="layui-btn" data-upload="img" data-upload-number="one"
                                         data-upload-exts="ico|png|jpg|jpeg"><i class="fa fa-upload"></i> 上传</a></span>
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">描述</label>
                        <div class="layui-input-block">
                            <textarea name="description" class="layui-textarea"
                                      placeholder="请输入描述"><?php echo e($article->description); ?></textarea>
                            <tip>填写描述。</tip>
                        </div>
                    </div>

                    <!--<div class="layui-form-item">-->
                    <!--    <label class="layui-form-label">属性</label>-->
                    <!--    <div class="layui-input-block">-->
                    <!--        <?php $__currentLoopData = $attributes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>-->
                    <!--            <input type="hidden" name="attr[ident][]" value="<?php echo e($item['ident']); ?>">-->
                    <!--            <input type="checkbox" name="attr[value][]" <?php if($article->{$item['ident']} == 1): ?> checked-->
                    <!--                   <?php endif; ?> lay-skin="primary" value="1" title="<?php echo e($item['name']); ?>">-->
                    <!--        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>-->
                    <!--    </div>-->
                    <!--</div>-->

                    <div class="layui-form-item">
                        <label class="layui-form-label required">内容</label>
                        <div class="layui-input-block">
                            <textarea id="content" name="content" rows="20" class="layui-textarea editor"
                                      placeholder="请输入内容"><?php echo e($article->content); ?></textarea>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label required">状态</label>
                        <div class="layui-input-block">
                            <input type="radio" name="status" lay-skin="primary" <?php if($article->status == 0): ?> checked <?php endif; ?> value="0" title="待发布">
                            <input type="radio" name="status" lay-skin="primary" <?php if($article->status == 1): ?> checked <?php endif; ?> value="1" title="已发布">
                        </div>
                    </div>

                </div>

                <div class="layui-tab-item">

                    <?php $__currentLoopData = $meta; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="layui-form-item">
                            <label class="layui-form-label required">配置</label>
                            <div class="layui-inline">
                                <div class="layui-input-inline">
                                    <input type="text" name="attr[ident][]" class="layui-input" placeholder="配置标识"
                                           value="<?php echo e($item->meta_key); ?>">
                                </div>
                                <div class="layui-input-inline">
                                    <input type="text" name="attr[value][]" class="layui-input" placeholder="配置值"
                                           value="<?php echo e($item->meta_value); ?>">
                                </div>
                            </div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                    <div class="layui-form-item">
                        <label class="layui-form-label required">配置</label>
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <input type="text" name="attr[ident][]" class="layui-input" placeholder="配置标识"
                                       value="">
                            </div>
                            <div class="layui-input-inline">
                                <input type="text" name="attr[value][]" class="layui-input" placeholder="配置值"
                                       value="">
                            </div>
                        </div>
                    </div>

                    <div class="layui-form-item" id="diy-button">
                        <label class="layui-form-label"></label>
                        <div class="layui-input-block">
                            <button type="button" id="add-diy-button"
                                    class="layui-btn layui-btn-primary layui-btn-sm">
                                新增配置 +
                            </button>
                        </div>
                    </div>

                </div>
            </div>

            <div class="hr-line"></div>
            <div class="layui-form-item text-center">
                <input type="hidden" name="id" value="<?php echo e($article->id); ?>">
                <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认</button>
                <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
            </div>
        </div>
    </form>
</div>


<div style="display: none" id="diy-tpl">
    <div class="layui-form-item">
        <label class="layui-form-label required">配置</label>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input type="text" name="attr[ident][]" class="layui-input" placeholder="配置标识" value="">
            </div>
            <div class="layui-input-inline">
                <input type="text" name="attr[value][]" class="layui-input" placeholder="配置值" value="">
            </div>
        </div>
    </div>
</div>

<script>
    layui.use(['jquery','laydate'], function () {
        var $ = layui.jquery;
        var laydate = layui.laydate;
        laydate.render({ 
          elem: '#a'
          ,type: 'datetime'
          ,range: true
        });
        $('#add-diy-button').click(
            function () {
                var html = $('#diy-tpl').html();
                $('#diy-button').before(html);
            }
        );
    });
</script>

</body>
</html>
<?php /**PATH /www/wwwroot/mycms/Modules/Cms/Resources/views/admin/article/edit.blade.php ENDPATH**/ ?>